package com.awesome.imagedemo.banner;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.awesome.imagedemo.R;
import com.youth.banner.Banner;
import com.youth.banner.indicator.CircleIndicator;

public class BannerActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_banner);

        Banner banner = findViewById(R.id.banner);
        banner.addBannerLifecycleObserver(this)//添加生命周期观察者
                .setAdapter(new ImageAdapter(DataBean.getTestData()))
                .setIndicator(new CircleIndicator(this));
    }
}